package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Spec entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_SPEC", schema = "MXZ")
public class Spec extends Entity implements java.io.Serializable {

	// Fields

	private Long specId;
	private SpecType specType;
	private String name;
	private String icon;
	private Long sort;
	private Long updateTime;

	// Constructors

	/** default constructor */
	public Spec() {
	}

	/** minimal constructor */
	public Spec(SpecType specType, String name, Long sort, Long updateTime) {
		this.specType = specType;
		this.name = name;
		this.sort = sort;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public Spec(SpecType specType, String name, String icon, Long sort,
			Long updateTime) {
		this.specType = specType;
		this.name = name;
		this.icon = icon;
		this.sort = sort;
		this.updateTime = updateTime;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_SPEC")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "SPEC_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getSpecId() {
		return this.specId;
	}

	public void setSpecId(Long specId) {
		this.specId = specId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SPEC_TYPE_ID", nullable = false)
	public SpecType getSpecType() {
		return this.specType;
	}

	public void setSpecType(SpecType specType) {
		this.specType = specType;
	}

	@Column(name = "NAME", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "ICON", length = 150)
	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Column(name = "SORT", nullable = false, precision = 15, scale = 0)
	public Long getSort() {
		return this.sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

}